//
// Created by xuyang on 2019/1/11.
//

#include <sys/stat.h>
#include <fcntl.h>
#include <zconf.h>
#include <printf.h>

#define FIFO_NAME "/Users/xuyang/workface/cpp/file_demo/a12.txt"
#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
int main(){
    mkfifo(FIFO_NAME,O_CREAT|O_EXCL|O_RDWR);
    int readfifo = open(FIFO_NAME,O_WRONLY,0);
    char* buffer="hello fifo";
    while (1){

    write(readfifo,buffer, sizeof(buffer));
    }

    return 0;
}